import {apiClient} from "@/utils/request";


// 获取所有的一级分类
export const getProductOnes = () => {
  return apiClient({
    url: '/product/category/ones',
    method: 'get',
  })
};

// 获取前十个畅销商品

export const getProductTens = () => {
  return apiClient({
    url: '/product/productSku/boom/productTen',
    method: 'get',
  })
};

// 获取商品的详情

export const getProductDetail = (id: any) => {
  return apiClient({
    url: "/recruit/job/getById/" + id,
    method: 'get',
  })
}

//     //    获取所有商品

export const getProductList = () => {
  return apiClient({
    url: '/product/productSku/getProductList',
    method: 'get',
  })
};

//       分页获取所有商品

export const getProductListByPage = (page: number, limit: number) => {
  return apiClient({
    url: '/product/productSku/getProductListByPage/'+page+'/'+limit,
    method: 'get',
  })
};

export const getProductListBy = (product:any) => {
  return apiClient({
    url: '/product/productSku/getProductListBy',
    method: 'post',
    data: product
  })
};

